package cn.tedu._05weibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
public class UserRegDTO {
    @ApiModelProperty(value = "用户名", required = true, example = "赵丽颖")
    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为null和空字符串")
    @NotBlank(message = "用户名不能为null和空字符串和空白串")
    @Size(min = 2, max = 10, message = "用户名长度必须在2~10之间")
    private String username;//用户名
    @ApiModelProperty(value = "密码", required = true, example = "123456")
    @Pattern(regexp = "^(?=.*[A-Za-z0-9])[A-Za-z0-9]{6,16}$",message = "密码最低6位数,只能是由大写或者小写英语字母和数字组成,长度最大为16位")
    private String password;//密码
    @ApiModelProperty(value = "昵称", required = true, example = "赵丽颖")
    private String nickname;//昵称
}
